/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Table_online_saver;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

/**
 *
 * @author Klu12
 */
public class HibernateUtils {

    private static final SessionFactory SESSION_FACTORY;

    static {
        try {
            SESSION_FACTORY = new AnnotationConfiguration().configure().buildSessionFactory();
        } catch(Throwable ex) {
            System.out.println("Initial SessionFactory creation failed."  + ex);
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory() {
        return SESSION_FACTORY;
    }
}
